package com.lagou.demo.controller;

import com.lagou.demo.service.ISecurityTestService;
import com.lagou.edu.mvcframework.annotations.LagouAutowired;
import com.lagou.edu.mvcframework.annotations.LagouController;
import com.lagou.edu.mvcframework.annotations.LagouRequestMapping;
import com.lagou.edu.mvcframework.annotations.LagouSecurity;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

@LagouController
@LagouRequestMapping("/test")
public class TestController {

    @LagouAutowired
    private ISecurityTestService securityTestService;

    @LagouRequestMapping("/noSecurity")
    public String noSecurity(HttpServletRequest request, HttpServletResponse response,String username){
        return securityTestService.noSecurity();
    }

    @LagouSecurity("lisi")
    @LagouRequestMapping("/methodSecurity")
    public String methodSecurity(HttpServletRequest request, HttpServletResponse response,String username){
        return securityTestService.methodSecurity();
    }




}
